package cn.edu.zut.hhr.utils;

import cn.edu.zut.hhr.entity.User;

public class UserUtil {

    private UserUtil(){}

    private static ThreadLocal<User> threadLocal = new ThreadLocal<>();

    public static void set(User user){
        threadLocal.set(user);
    }

    public static User getCurrentUser(){
        return threadLocal.get();
    }

    public static User currentUser(){
        return threadLocal.get();
    }

    public static void del(){
        threadLocal.remove();
    }

}
